package com.dc.adaptor.persistance;

import java.util.List;
import java.util.Map;

import org.pentaho.di.core.database.Database;

import com.dc.adaptor.persistance.bean.ForeignExchangeInfo;
import com.dc.adaptor.persistance.bean.SipContent;
import com.dc.adaptor.persistance.bean.SipProtocol;
import com.dc.adaptor.persistance.bean.SipRecvPack;
import com.dc.adaptor.persistance.bean.SipSendPack;

public interface PersistenceHandler {
	
	public void saveReceivePack(SipRecvPack sipPack)throws Exception;
	
	public void saveSendPack(SipSendPack sipPack)throws Exception;
	
	public SipSendPack findSendPack(String id)throws Exception;
	
	public SipRecvPack findReceivePack(String id)throws Exception;
	
	public SipContent findContent(String id)throws Exception;
	
	public void saveContent(SipContent sipContent)throws Exception;
	
	public void saveProtocol(SipProtocol sipProtocol)throws Exception;
	
	public SipProtocol findProtocol(String id)throws Exception;
	
	public void updateSendPackStatus(SipSendPack sipPack)throws Exception;
	
	public void updateReceivepackStatus(SipRecvPack sipPack)throws Exception;
	
	public boolean hasAllReceviePack(String groupSn)throws Exception;
	
	public List<SipRecvPack> findAllReceviePack(String groupSn)throws Exception;
	
	public void setLoadContent(boolean load);
	
	public void setSaveContent(boolean save);
	
    public boolean getLoadContent();
	
	public boolean getSaveContent();
	
	public String getMessageConvertorClassname(String name,String type)throws Exception;
	
	public void close();
	
	public Database getDb();
	
	public List<ForeignExchangeInfo> findRecvMessages(String groupSn, String jobName) throws Exception;
	
	public List<ForeignExchangeInfo> findSendMessages(String groupSn) throws Exception;
	
	public void updateReceivepack(SipRecvPack sipPack,String contentId) throws Exception;

	public List<SipRecvPack> findRecvPacks(String messageId) throws Exception;
		
}
